package com.hsgene.common.util.jwt;


/**
 * @version 2017-10-27
 */
public class JwtTokenUtil {

    private int expire;

    private String priKeyPath;

    private String pubKeyPath;

    public JwtTokenUtil(int expire, String priKeyPath, String pubKeyPath) {
        this.expire = expire;
        this.priKeyPath = priKeyPath;
        this.pubKeyPath = pubKeyPath;
    }

    public String generateToken(IJWTInfo jwtInfo) throws Exception {
        return JWTHelper.generateToken(jwtInfo, priKeyPath, expire);
    }

    public IJWTInfo getInfoFromToken(String token) throws Exception {
        return JWTHelper.getInfoFromToken(token, pubKeyPath);
    }


}
